using System;
using System.Collections.Generic;
using System.Text;

namespace SqlToolkit.Oracle.Schema
{
    public class SqlDbViewCollection :SqlToolkit.SqlDataObjectCollectionBase
    {
        #region Construction
        public SqlDbViewCollection() { }
        #endregion
        #region Add
        public int Add(SqlDbView value)
        {
            return base.Add(value);
        }
        #endregion
        #region IndexOf
        public int IndexOf(SqlDbView value)
        {
            return base.IndexOf(value);
        }
        #endregion
        #region Insert
        public void Insert(int index, SqlDbView value)
        {
            base.Insert(index, value);
        }
        #endregion
        #region Remove
        public void Remove(SqlDbView value)
        {
            base.Remove(value);
        }
        #endregion
        #region Indexer
        new public SqlDbView this[int index]
        {
            get { return (SqlDbView)base[index]; }
        }
        #endregion

        public SqlDbView GetView(string viewName)
        {
            if (this.Count < 1) { return null; }

            foreach (SqlDbView vw in this)
            {
                if (vw.ViewName.ToUpper().Trim() == viewName.ToUpper().Trim())
                {
                    return vw;
                }
            }

            return null;
        }
    }
}
